package com.example.springbootdemo.demos.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/SpringbootDemo")
public class RandomController {

    @GetMapping("/random")
    @ResponseBody
    public String random(String[] args) {
        int num=(int)(Math.random()*1000);
        return "随机数为:"+num;
    }

}
